import modules from "./modules";
//这里仅示范npm安装方式的引入，其它方式引入请看最上面【安装】部分
import { RouterMount, createRouter } from "uni-simple-router";

//初始化
const router = createRouter({
  platform: process.env.VUE_APP_PLATFORM,
  routes: [...modules], //路由表
});

//全局路由前置守卫
router.beforeEach((to, from, next) => {
  next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
  console.log(to, from);
});

export { router, RouterMount };
